package com.hao.wms.mvc;

import com.hao.wms.domain.Employee;
import com.hao.wms.service.IEmployeeService;
import com.hao.wms.util.MD5;

public class LoginAction extends BaseAction{
	private IEmployeeService employeeService;
	private String userName;
	private String password;
	public String execute() {
		try {
			Employee e = employeeService.login(userName, MD5.encode(password));
		} catch (Exception e) {
			e.printStackTrace();
			addActionError(e.getMessage());
			return LOGIN;
		}
		return SUCCESS;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public void setEmployeeService(IEmployeeService employeeService) {
		this.employeeService = employeeService;
	}
	
}
